/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="sales_return")
public class SalesReturn implements Serializable {
	public SalesReturn() {
	}
	
	private int id;
	
	private String returnDetail;
	
	private cn.imvc.app.entities.Orders order;
	
	private String orderCode;
	
	private cn.imvc.app.entities.Member member;
	
	private Integer refundAmount;
	
	private Byte type;
	
	private Byte state;
	
	private String remark;
	
	private String reply;
	
	private Integer userId;
	
	private java.util.Date createdAt;
	
	private java.util.Date updatedAt;
	
	private Integer applyAmount;
	
	private java.util.Date refundTime;
	
	private String reason;
	
	private String imageUrl;
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_SALESRETURN_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_SALESRETURN_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	/**
	 * 1一级订单 2二级订单 3三级订单
	 */
	public void setReturnDetail(String value) {
		this.returnDetail = value;
	}
	
	/**
	 * 1一级订单 2二级订单 3三级订单
	 */
	@Column(name="returnDetail", nullable=true, length=255)	
	public String getReturnDetail() {
		return returnDetail;
	}
	
	/**
	 * 订单编号 一级、二级或三级
	 */
	public void setOrderCode(String value) {
		this.orderCode = value;
	}
	
	/**
	 * 订单编号 一级、二级或三级
	 */
	@Column(name="orderCode", nullable=true, length=255)	
	public String getOrderCode() {
		return orderCode;
	}
	
	/**
	 * 退款金额
	 */
	public void setRefundAmount(int value) {
		setRefundAmount(new Integer(value));
	}
	
	/**
	 * 退款金额
	 */
	public void setRefundAmount(Integer value) {
		this.refundAmount = value;
	}
	
	/**
	 * 退款金额
	 */
	@Column(name="refundAmount", nullable=true, length=10)	
	public Integer getRefundAmount() {
		return refundAmount;
	}
	
	/**
	 * 退货类型 1.退货退款 2.仅退款
	 */
	public void setType(byte value) {
		setType(new Byte(value));
	}
	
	/**
	 * 退货类型 1.退货退款 2.仅退款
	 */
	public void setType(Byte value) {
		this.type = value;
	}
	
	/**
	 * 退货类型 1.退货退款 2.仅退款
	 */
	@Column(name="type", nullable=true)	
	public Byte getType() {
		return type;
	}
	
	/**
	 * 退款状态
	 */
	public void setState(byte value) {
		setState(new Byte(value));
	}
	
	/**
	 * 退款状态
	 */
	public void setState(Byte value) {
		this.state = value;
	}
	
	/**
	 * 退款状态
	 */
	@Column(name="state", nullable=true)	
	public Byte getState() {
		return state;
	}
	
	/**
	 * 备注退款说明
	 */
	public void setRemark(String value) {
		this.remark = value;
	}
	
	/**
	 * 备注退款说明
	 */
	@Column(name="remark", nullable=true, length=255)	
	public String getRemark() {
		return remark;
	}
	
	/**
	 * 回复
	 */
	public void setReply(String value) {
		this.reply = value;
	}
	
	/**
	 * 回复
	 */
	@Column(name="reply", nullable=true, length=255)	
	public String getReply() {
		return reply;
	}
	
	/**
	 * 处理人id
	 */
	public void setUserId(int value) {
		setUserId(new Integer(value));
	}
	
	/**
	 * 处理人id
	 */
	public void setUserId(Integer value) {
		this.userId = value;
	}
	
	/**
	 * 处理人id
	 */
	@Column(name="userId", nullable=true, length=10)	
	public Integer getUserId() {
		return userId;
	}
	
	public void setCreatedAt(java.util.Date value) {
		this.createdAt = value;
	}
	
	@Column(name="createdAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getCreatedAt() {
		return createdAt;
	}
	
	public void setUpdatedAt(java.util.Date value) {
		this.updatedAt = value;
	}
	
	@Column(name="updatedAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getUpdatedAt() {
		return updatedAt;
	}
	
	public void setApplyAmount(int value) {
		setApplyAmount(new Integer(value));
	}
	
	public void setApplyAmount(Integer value) {
		this.applyAmount = value;
	}
	
	@Column(name="applyAmount", nullable=true, length=10)	
	public Integer getApplyAmount() {
		return applyAmount;
	}
	
	public void setRefundTime(java.util.Date value) {
		this.refundTime = value;
	}
	
	@Column(name="refundTime", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getRefundTime() {
		return refundTime;
	}
	
	public void setReason(String value) {
		this.reason = value;
	}
	
	@Column(name="reason", nullable=true, length=255)	
	public String getReason() {
		return reason;
	}
	
	public void setImageUrl(String value) {
		this.imageUrl = value;
	}
	
	@Column(name="imageUrl", nullable=true, length=255)	
	public String getImageUrl() {
		return imageUrl;
	}
	
	public void setMember(cn.imvc.app.entities.Member value) {
		this.member = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Member.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="memberId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Member getMember() {
		return member;
	}
	
	public void setOrder(cn.imvc.app.entities.Orders value) {
		this.order = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Orders.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="orderId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Orders getOrder() {
		return order;
	}
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("SalesReturn[ ");
			sb.append("Id=").append(getId()).append(" ");
			sb.append("ReturnDetail=").append(getReturnDetail()).append(" ");
			if (getOrder() != null)
				sb.append("Order.Persist_ID=").append(getOrder().toString(true)).append(" ");
			else
				sb.append("Order=null ");
			sb.append("OrderCode=").append(getOrderCode()).append(" ");
			if (getMember() != null)
				sb.append("Member.Persist_ID=").append(getMember().toString(true)).append(" ");
			else
				sb.append("Member=null ");
			sb.append("RefundAmount=").append(getRefundAmount()).append(" ");
			sb.append("Type=").append(getType()).append(" ");
			sb.append("State=").append(getState()).append(" ");
			sb.append("Remark=").append(getRemark()).append(" ");
			sb.append("Reply=").append(getReply()).append(" ");
			sb.append("UserId=").append(getUserId()).append(" ");
			sb.append("CreatedAt=").append(getCreatedAt()).append(" ");
			sb.append("UpdatedAt=").append(getUpdatedAt()).append(" ");
			sb.append("ApplyAmount=").append(getApplyAmount()).append(" ");
			sb.append("RefundTime=").append(getRefundTime()).append(" ");
			sb.append("Reason=").append(getReason()).append(" ");
			sb.append("ImageUrl=").append(getImageUrl()).append(" ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
